package org.argus.job.common.enums;

import com.google.common.collect.Lists;

import java.util.List;

/**
 * Status of the job instance
 * @Author 刘文/Cliff Liu
 * @Date 2024/8/27
 */
public enum InstanceStatus {
    /**
     * 等待派发
     */
    WAITING_DISPATCH,
    /**
     * 等待Worker接收
     */
    WT_WORKER_RCV,
    /**
     * 运行中
     */
    RUNNING,
    /**
     * 失败
     */
    FAILED,
    /**
     * 成功
     */
    SUCCEED,
    /**
     * 取消
     */
    CANCELED,
    /**
     * 手动停止
     */
    STOPPED;

    /**
     * 广义的运行状态
     */
    public static final List<InstanceStatus> GENERALIZED_RUNNING_STATUS = Lists.newArrayList(WAITING_DISPATCH, WT_WORKER_RCV, RUNNING);
    /**
     * 结束状态
     */
    public static final List<InstanceStatus> FINISHED_STATUS = Lists.newArrayList(FAILED, SUCCEED, CANCELED, STOPPED);
}
